<?php 

$http=new swoole_http_server('0.0.0.0',8811);

$http->on('request',function ($request,$response){
    $redis=new Swoole\Coroutine\Redis();
    $redis->connect('127.0.0.1',6379);
    
    $val=$redis->get($request->get['a']);
    
    $response->header("Content-Type",'text/plain');
    
    $response->end("Ϊ". $val);
    
});

$http->start();